import { getPhoto } from '@/api/user/myAccount'
import { Message } from 'element-ui'
import { cloneDeep } from 'lodash'
export default {
    namespaced: true,
    state: {
        imgUrl: "https://img2.doubanio.com/view/group_topic/l/public/p370468411.webp" || JSON.parse(sessionStorage.getItem('imgUrl')),
    },
    mutations: {
        GETPHOTO_(state, url) {
            state.imgUrl = url
        },
    },
    actions: {
        async getPhoto_({ commit }) {
            let result = await getPhoto()
            let blob = new Blob([result]); // 返回的文件流数据
            let url = window.URL.createObjectURL(blob); // 将他转化为路径
            commit('GETPHOTO_', url)
        },
    },
    getters: {

    }
}